#pragma once

#include <list>
typedef void(*PTIMERFUNC )(char *pParams);

/************************************************************************/
/* Service struct                                                       */
/************************************************************************/
struct TimerData
{
	unsigned int	uiTimerId;
	unsigned int	uiInterval;
	unsigned int	uiResiduaryTime;
	bool			fPaused;

	PTIMERFUNC pFunc;
	char *pParams;
};


class Timers
{
public:
	Timers();

	unsigned int Create(unsigned int uiInterval, PTIMERFUNC pFunction, char *pParams);
	void Start(unsigned int uiID);
	void Pause(unsigned int uiID);
	void Delete(unsigned int uiID);
	void UpdateAll(unsigned int uiMilliSeconds);
	unsigned int GenID();
private:
	std::list<TimerData>	m_Timers;
	unsigned int maxID;
};
